Skip to content

Conversation

@36864
Copy link
Contributor

@36864 36864 commented Apr 11, 2025

Fixes #14734.

Also only loads log entries for the current user. We only care about the last log entry that contains a signature on this page. This should speed up the page a bit for cases where assets have long histories. There's room for improvement there but I'm not sure how well limits work on eager loaded relations.

The assetlog relation was only being used for this, and because of the new method being in the Loggable trait, it makes sense to use the log relation instead.

36864 added 3 commits April 11, 2025 16:24
Also unifies the way these things are fetched.
This makes the print page much tidier.
@what-the-diff
Copy link

what-the-diff bot commented Apr 11, 2025

PR Summary

  • Enhanced Asset and Accessory Log Retrieval:

    • The process for retrieving asset and accessory logs has been updated. Previously, the code was using assetlog and assetlog->firstWhere. Now, it's using a new method, log, with conditional queries. This is done in the UsersController.php file. The new process is more streamlined and efficient.
  • New Method added to Loggable Model:

    • A new method called getLatestSignedAcceptance has been introduced. This method fetches the most recent signed acceptance log for a specific user. This improves the performance and versatility of the Loggable model, making it more resourceful for handling user logs.
  • Updated Signature Display in Views:

    • The code for displaying digital signatures has been updated in the print.blade.php file. Previously, the first acceptance log was directly accessed. Now, the new getLatestSignedAcceptance method is used to ensure the most recent signature is consistently displayed across all asset types including assets, licenses, accessories, and consumables. This change leads to a more accurate and up-to-date display of digital signatures.

@snipe snipe merged commit 5bae74b into grokability:develop Apr 19, 2025
9 checks passed
@36864 36864 deleted the patch-1 branch April 21, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants